﻿using System.Windows.Controls;
using System.Windows.Input;
using System.Windows;

namespace config.view
{
    public partial class BasicSet : UserControl
    {
        public BasicSet()
        {
            InitializeComponent();
        }

        private void NumberValidationTextBox(object sender, TextCompositionEventArgs e)
        {
            // 只允许输入数字
            foreach (char c in e.Text)
            {
                if (!char.IsDigit(c))
                {
                    e.Handled = true;
                    break;
                }
            }
        }

        private void ResetToDefaults_Click(object sender, RoutedEventArgs e)
        {
            // 重置所有设置为默认值
            RotationAngleSlider.Value = 900;
            ForceFeedbackSlider.Value = 80;
            CenterSpringSlider.Value = 50;
            DamperSlider.Value = 30;
            //InertiaSlider.Value = 20;
            FrictionSlider.Value = 15;

            // 可以添加提示消息
            MyMessageBox.Show("已重置为默认设置");
        }

        private void SaveSettings_Click(object sender, RoutedEventArgs e)
        {
            // 保存设置逻辑
            // 这里可以添加保存到配置文件或设备的代码

            MyMessageBox.Show("设置已发送给方向盘");
        }
    }
}